Why is Jest claiming a mocked function isn't being called when it clearly is